package com.yf.exam.modules.exam.dto.response;

import com.yf.ability.excel.annotation.ExcelField;
import com.yf.base.api.annon.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
* <p>
* 考试记录数据传输类
* </p>
*
* @author 聪明笨狗
* @since 2020-09-21 15:13
*/
@Data
@ApiModel(value="考试记录", description="考试记录")
public class ExamRecordRespDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    private String id;



    @ApiModelProperty(value = "考试名称", required=true)
    private String title;

    @ExcelField(title = "人员")
    @ApiModelProperty(value = "人员名称", required=true)
    private String realName;

    @ApiModelProperty(value = "用户ID", required=true)
    private String userId;

    @Dict(dictTable = "el_exam", dicText = "title", dicCode = "id")
    @ApiModelProperty(value = "考试ID", required=true)
    private String examId;
    private String examId_dictText;

    @ExcelField(title = "考试次数", sort = 1)
    @ApiModelProperty(value = "考试次数", required=true)
    private Integer tryCount;

    @ApiModelProperty(value = "结果展示类型", required=true)
    private Integer resultType;

    @ExcelField(title = "最高分数", sort = 2)
    @ApiModelProperty(value = "最高分数", required=true)
    private BigDecimal maxScore;


    @ApiModelProperty(value = "是否通过", required=true)
    private Boolean passed;

    @ApiModelProperty(value = "用户部门")
    private String deptCode;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ExcelField(title = "最后考试时间", sort = 4)
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;


    @ExcelField(title = "是否通过", sort = 3)
    public String getPassStr(){
        if(this.passed!=null && this.passed){
            return "通过";
        }
        return "未通过";
    }

    
}
